<template>
    <div>
        <el-table :data="tableData" border header-align="right" :header-cell-style="{ background: '#f2f6fc' }"
            header-cell-class-name="center" cell-class-name="center" empty-text="暂无数据">
            <el-table-column prop="date" label="商品合计">
                <template #default="{ row }">
                    <span>{{ "￥"+row.totalAmount }}</span>
                </template>
            </el-table-column>
            <el-table-column label="运费">
                <template #default="{ row }">
                    <span>{{ "￥"+row.freightAmount }}</span>
                </template>
            </el-table-column>
            <el-table-column prop="address" label="优惠券">
                <template #default="{ row }">
                    <span>{{ "-￥"+row.couponAmount }}</span>
                </template>
            </el-table-column>
            <el-table-column prop="address" label="积分抵扣">
                <template #default="{ row }">
                    <span>{{ "-￥"+row.integrationAmount }}</span>
                </template>
            </el-table-column>

        </el-table>
        <el-table :data="tableData" border header-align="right" :header-cell-style="{ background: '#f2f6fc' }"
            header-cell-class-name="center" cell-class-name="center" empty-text="暂无数据">
            <el-table-column prop="address" label="活动优惠">
                <template #default="{ row }">
                    <span>{{
                        "-￥"+row.promotionAmount
                    }}</span>
                </template>
            </el-table-column>
            <el-table-column label="折扣金额">
                <template #default="{ row }">
                    <span>{{ "-￥"+ row.discountAmount }}</span>
                </template>
            </el-table-column>
            <el-table-column label="订单总金额">
                <template #default="{ row }">
                    <span style="color: red;">{{ "￥"+(row.totalAmount + row.freightAmount) }}</span>
                </template>
            </el-table-column>
            <el-table-column label="应付款金额">
                <template #default="{ row }">
                    <span style="color: red;">{{
                        "￥"+(row.totalAmount +
                            row.freightAmount - row.couponAmount - row.promotionAmount -
                            row.discountAmount - row.integrationAmount)
                    }}</span>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script setup lang="ts">
const props = defineProps({
    tableData: {
        type: Array,
        default: []
    }
})
</script>

<style scoped>

</style>